﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPGL.ascx.cs" Inherits="TaoSH.View.SPGL" %>
<script type="text/javascript" src="../../JqueryPlug/umeditor122/umeditor.js"></script>
<script type="text/javascript" src="../../JqueryPlug/umeditor122/umeditor.config.js"></script>




<table class="table table-bordered  table-hover table-hover">
    <tbody>
        <tr>
            <td class="FormLable">类别</td>
            <td>
                <asp:DropDownList runat="server" class="form-control  input-sm lb1" ID="conSPLB1" AutoPostBack="True" OnSelectedIndexChanged="conSPLB1_SelectedIndexChanged">
                </asp:DropDownList>


            </td>
            <td class="FormLable">子类别</td>
            <td>
                <asp:DropDownList runat="server" class="form-control  input-sm lb2" ID="conSPLB2">
                </asp:DropDownList></td>
            <td class="FormLable">上架状态</td>
            <td>
                <asp:DropDownList runat="server" class="form-control  input-sm" ID="conSJ">
                    <asp:ListItem Text="下架" Value="0" />
                    <asp:ListItem Text="上架" Value="1" />

                </asp:DropDownList>
            </td>

        </tr>
        <tr>
         
            <td class="FormLable">商品名称</td>
            <td>
                <input type="text" class="form-control  input-sm validate[required]" runat="server" id="conSPName" /></td>
            <td class="FormLable">商品标签
            </td>
            <td colspan="3">
                <asp:DropDownList runat="server" class="form-control  input-sm" ID="donSPBQ">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="FormLable">原价</td>
            <td>
                <input type="text" class="form-control  input-sm  validate[required,custom[number]]" runat="server" id="conSCJ" /></td>
            <td class="FormLable">销售价</td>
            <td>
                <input type="text" class="form-control  input-sm  validate[required,custom[number]]" runat="server" id="conXSJ" /></td>
            <td class="FormLable"> 成本价</td>
            <td>
                <input type="text"  class="form-control  input-sm  validate[required,custom[number]]" runat="server" id="conCBJ" />

            </td>
        </tr>
       
    </tbody>
</table>
<div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">商品属性</div>
    <div class="panel-body">
        <p><a class="btn btn-info xzspsx" href="javascript:void(0)">选择属性</a></p>
    </div>

    <!-- List group -->
    <ul class="list-group sxlist">
    </ul>
</div>
<table class="table table-bordered  table-hover table-hover">
    <tbody>
         <tr>
            <td class="FormLable">商品简介</td>
            <td colspan="5">
                <input type="text" class="form-control  input-sm " runat="server" id="conSummary"   /></td>

        </tr>
        <tr>
            <td class="FormLable">商品图片（必填）</td>
            <td colspan="5">
                <input type="text" class="form-control  input-sm  FT_Upload" runat="server" id="conSPTP" title="上传图片" filetype="pic" /></td>

        </tr>
        
        <tr>
            <td class="FormLable">商品详细内容</td>
            <td colspan="5">
                <asp:TextBox ID="conSPXX" runat="server" TextMode="MultiLine" CssClass="form-control UEEDIT"></asp:TextBox>

            </td>
        </tr>
    </tbody>
</table>

<input type="hidden" runat="server" class="hidData" id="hidData" />
<script>
    $(function () {
        $(".xzspsx").click(function () {
            if ($(".lb1").val() != "" && $(".lb1").val() != "") {
                MyDialog.btviewP('选择商品属性', 'url:SpeList/SelSPSX.html?lb1=' + escape($(".lb1 option:selected").text()) + '&lb2=' + escape($(".lb2 option:selected").text()), '确认', function () {
                    var selrowdata = this.content.getselsx();
                    $(".sxlist").empty();
                    for (var i = 0; i < selrowdata.length; i++) {
                        $(".sxlist").append("<li class='list-group-item'><strong>" + selrowdata[i].sxname + "</strong>:" + selrowdata[i].sxvalue + "</li>")
                    }
                    $(".hidData").val(JSON.stringify(selrowdata))
                }, 420, 300, frameElement.api);
            } else {
                alert('请选择类别')
            }
          
        })
        if ($(".hidData").val() != "") {
            var selrowdata = $.parseJSON($(".hidData").val());
            $(".sxlist").empty();
            for (var i = 0; i < selrowdata.length ; i++) {
                $(".sxlist").append("<li class='list-group-item'><strong>" + selrowdata[i].sxname + "</strong>:" + selrowdata[i].sxvalue + "</li>")
            }
        }

    })
</script>
